#include <assert.h>
#include "storagedao_factory.h"
#include "storagedao_stub4web.h"
#include "storagedao_stub4app.h"
//#include "storagedao.h"

using namespace erp::storage::dao;

bool CStorageDaoFactory::s_StorageDaoInit = false;

IStorageDao* CStorageDaoFactory::GetObject(enum ObjType_T obj_type)
{
    switch(obj_type)
    {
    case STUB4APP:
        return (new CStorageDaoStub4App);
/*适应container3
    case POCO:
    {
        if(!s_StorageDaoInit)
        {
            int iRetCode = CStorageDao::Initialize();
            assert(iRetCode == 0);
            s_StorageDaoInit = true;
        }   	
        return (new CStorageDao);
	}*/
    default:
        assert(0);
    };
    return NULL;
}

IStorageDaoAsyc* CStorageDaoFactory::GetAsycObject()
{
	return (new CStorageDaoStub4App);
}
